package com.smartcommunity.entity.people.dto;

import com.smartcommunity.base.common.CacheMap;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@ApiModel
public class AddRealPowerDto implements Serializable {
    private static final long serialVersionUID = -1L;

    @NotBlank(message = "小区编号不能为空！")
    @ApiModelProperty(value="小区编号",name="villageCode",example = "123456")
    private String villageCode;

    @NotBlank(message = "证件号码不能为空！")
    @ApiModelProperty(value="证件号码",name="credentialNo",example = "420624199909093332")
    private String credentialNo;

    @NotBlank(message = "证件类型不能为空！")
    @ApiModelProperty(value="证件类型，居民身份证111，军官证 114，警官证123，普通护照414",name="credentialType",example = "111")
    private String credentialType ="111";

    @NotBlank(message = "姓名不能为空！")
    @ApiModelProperty(value="姓名",name="certificatesName",example = "张三")
    private String certificatesName;

    @ApiModelProperty(value="居住地址",name="residentialAddress",example = "XXX")
    private String residentialAddress;

    @ApiModelProperty(value="户籍地址",name="domicileAddress",example = "XXX")
    private String domicileAddress;

    @ApiModelProperty(value="手机号",name="phoneNumber",example = "15555555555")
    private String phoneNumber;

    @ApiModelProperty(value="性别",name="gender",example = "男")
    private String gender;

    @ApiModelProperty(value="性别编码",name="genderCode",example = "1")
    private String genderCode;

    @ApiModelProperty(value="证件照",name="idCardPic")
    private String idCardPic;

    @ApiModelProperty(value="实有力量",name="realPowerFlag")
    private Integer realPowerFlag;

    @ApiModelProperty(value="实有力量标签",name="labels")
    private List<Integer> labels;

    @ApiModelProperty(value="公司名称",name="companyName")
    private String companyName;

    @ApiModelProperty(value="入库时间",name="mrowTime",hidden = true)
    private Date mrowTime;

    public void setGender(){
        if(this.genderCode==null){
            this.gender=null;
        }else {
            this.gender = CacheMap.GENDER_MAP.get(this.genderCode);
        }
    }



}
